<?php
/**
 * @package    Blog
 * @subpackage Model
 */

class Login
{
 
    /**
     * @var object Zend DB Adapter
     */
    private $_db;
    /**
     * @var string
     */
   
    public function __construct()
    {
			$this->_db = Zend_Registry::get('db');
    }

    public function userLogin($formValues)
    {
		$username = $formValues['username'];
		$password = $formValues['password'];
		
		$getUserDetails = $this->_db->fetchAll("
			SELECT userid, firstname, lastname, email_address
			FROM user
			WHERE username = '" . $username . "' AND passwd = '" . md5($password) . "' AND status = 1
		");
		
		return $getUserDetails;
	}
}
